import { http } from '@/utils/http'

/** 查询公告列表 */
export const listNotice = (params?: object) => {
  return http.request<HttpPaginationResponse<Array<any>>>('get', '/system/notice/list', {
    params,
  })
}

/** 查询公告详细 */
export const getNotice = (noticeId: number) => {
  return http.request<HttpResponse<Object>>('get', '/system/notice/' + noticeId)
}

/** 新增公告 */
export const addNotice = (data?: object) => {
  return http.request<HttpResponse<Object>>('post', '/system/notice', {
    data,
  })
}

/** 修改公告 */
export const updateNotice = (data?: object) => {
  return http.request<HttpResponse<Object>>('put', '/system/notice', {
    data,
  })
}

/** 删除公告 */
export const delNotice = (noticeId?: string) => {
  return http.request<HttpResponse<Object>>('delete', '/system/notice/' + noticeId)
}
